/*
copyright:    2009-2010 by Alexander D.
license:      GPL


This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
*/

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace WAM.API
{
    class WTF
    {
        Main main = new Main();
        Misc misc = new Misc();
        public WTF()
        {
        }
        public string[] GetAccounts()
        {
            string[] Accounts = Directory.GetDirectories(misc.iPath + "WTF\\Account\\");
            for (short i=0;i<Accounts.Length;++i)
            {
                Accounts[i] = Accounts[i].Remove(0, (misc.iPath.Length + 12));
            }
            return Accounts;
        }
        public string[] GetRealms(string Account)
        {
            string[] Realms = Directory.GetDirectories(misc.iPath + "WTF\\Account\\" + Account.ToUpper());
            for (short i=0;i<Realms.Length;++i)
            {
                Realms[i] = Realms[i].Remove(0, (misc.iPath.Length + Account.Length + 13));
            }
            return Realms;
        }
        public string[] GetCharacter(string Account, string Realm)
        {
            string[] Characters = Directory.GetDirectories(misc.iPath + "WTF\\Account\\" + Account.ToUpper() + "\\" + Realm);
            for (short i = 0; i < Characters.Length; ++i)
            {
                Characters[i] = Characters[i].Remove(0, (misc.iPath.Length + Account.Length + Realm.Length + 14));
            }
            return Characters;
        }
    }
}
